package com.example.flying_personnel_management_system.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.example.flying_personnel_management_system.pojo.SysDept;
import com.example.flying_personnel_management_system.pojo.WorkStatement;
import com.example.flying_personnel_management_system.services.SericeDaoImp_Wu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class Controller_Wu {
    @Autowired
    SericeDaoImp_Wu sericeDaoImp_wu;

    //跳转到工作报告页面
    @RequestMapping(value = "/was")
    public String was(){
        return "workReport_wu";
    }

    //显示所有报告
    @RequestMapping(value = "/wsall",method = RequestMethod.POST,produces = "text/plain;charset=UTF-8")
    @ResponseBody
    public String wsAll(String name,String bumen){
        return JSON.toJSONString(sericeDaoImp_wu.wsAll(name,bumen));
    }

    //显示所有部门 wu
    @RequestMapping(value = "/allbm",method = RequestMethod.POST,produces = "text/plain;charset=UTF-8")
    @ResponseBody
    public String allbm(String kk){
        List<SysDept> sysDept=sericeDaoImp_wu.allbm();
        return JSON.toJSONString(sericeDaoImp_wu.allbm());
    }
}
